package com.travel.model.entity.service;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.persistence.*;
import lombok.Data;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import java.time.LocalDateTime;

@Data
@Entity
@Table(name = "destinations")
@EntityListeners(AuditingEntityListener.class)
@Schema(description = "Travel destination entity")
public class Destination {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Schema(description = "Destination ID")
    private Long id;

    @Schema(description = "Destination name")
    @Column(nullable = false)
    private String name;

    @Schema(description = "Destination description")
    @Column(columnDefinition = "TEXT")
    private String description;

    @Schema(description = "Destination city")
    private String city;

    @Schema(description = "Destination address")
    private String address;

    @Schema(description = "Destination image URL")
    private String imageUrl;

    @Schema(description = "Destination status (1: active, 0: inactive)")
    private Integer status = 1;

    @CreatedDate
    @Schema(description = "Creation time")
    private LocalDateTime createdTime;

    @LastModifiedDate
    @Schema(description = "Last update time")
    private LocalDateTime updatedTime;
} 